<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('汇报生产进度日志')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-erpWorkProcessLog-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">汇报批次：</label>
                <div class="col-sm-8">
                    <input name="batchNo" readonly onclick="openSelectBatch()" class="form-control" placeholder="点击选择" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单号：</label>
                <div class="col-sm-8">
                    <input name="orderNo" readonly class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生产型号：</label>
                <div class="col-sm-8">
                    <input name="modeNo" readonly class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">汇报的工序：</label>
                <div class="col-sm-8">
                    <select name="curProcess" class="form-control m-b" th:with="type=${@dict.getType('erp_process_state')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">入数：</label>
                <div class="col-sm-8">
                    <input name="inTotal" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">出数：</label>
                <div class="col-sm-8">
                    <input name="outTotal" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">欠交量：</label>
                <div class="col-sm-8">
                    <input name="oweFqcTotal" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">规格-长：</label>
                <div class="col-sm-8">
                    <input name="specLength" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">规格-宽：</label>
                <div class="col-sm-8">
                    <input name="specWide" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">面积：</label>
                <div class="col-sm-8">
                    <input name="area" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "erp/erpWorkProcessLog"
        $("#form-erpWorkProcessLog-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-erpWorkProcessLog-add').serialize());
            }
        }

        // 选择批次
        function openSelectBatch() {
            var url = ctx + "../../erp/erpBatchInfo/pageSelectBatch";
            var options = {
                title: '选择批次号',
                width: 1200,
                url: url,
                callBack: doSelectBatchSubmit
            };
            $.modal.openOptions(options);
        }

        function doSelectBatchSubmit(index, layero) {
            var body = layer.getChildFrame('body', index);
            var batchNo = body.find('#batchNo').val();
            var orderNo = body.find('#orderNo').val();
            var modeNo = body.find('#modeNo').val();
            var customerNo = body.find('#customerNo').val();
            layer.close(index);
            if (batchNo != "" && batchNo != undefined) {
                $("input[name='batchNo']").val(batchNo);
                $("input[name='orderNo']").val(orderNo);
                $("input[name='modeNo']").val(modeNo);
                $("input[name='customerNo']").val(customerNo);
            }
        }
    </script>
</body>
</html>